package com.ny.service.impl;

import com.ny.entity.DeviceMongo;
import com.ny.repository.DeviceMongoRepository;
import com.ny.service.DeviceMongoService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class DeviceMongoServiceImpl implements DeviceMongoService {
    
    @Autowired
    private DeviceMongoRepository deviceMongoRepository;
    
    @Override
    public List<DeviceMongo> findAllDevices() {
        return deviceMongoRepository.findAll();
    }
    
    @Override
    public List<DeviceMongo> findDevicesByName(String deviceName) {
        return deviceMongoRepository.findByDeviceNameContaining(deviceName);
    }
}